import React from 'react'
import MdEditor from 'react-markdown-editor-lite';
// import style manually
import ReactMarkdown from 'react-markdown'
import 'react-markdown-editor-lite/lib/index.css';
function Com() {
  return (
    <div>
      <h1>markdown编辑器</h1>
      <MdEditor 
        style={{ height: '500px' }} 
        renderHTML = { (text) => {
          return (
            <ReactMarkdown>
              { text }
            </ReactMarkdown>
          )
        }}
        onChange={ ({ html, text }) => {
          // console.log('handleEditorChange', html, text);
          console.log('handleEditorChange', html, text);
        }} >
        </MdEditor>
    </div>
  )
}

export default Com
